package cn.edu.scau.cmi.yejiancong.ORM_hibernate.Utils;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class hibernateUtils {
	private static Configuration configuration=null;
	private static SessionFactory sessionFactory=null;
	static {
		configuration=new Configuration();
		configuration.configure();
		sessionFactory=configuration.buildSessionFactory();
		
	}
	public static Session getSessionOnobject() {
		return sessionFactory.getCurrentSession();
	}

	public static SessionFactory getSessionFactory() {
		return sessionFactory;
	}
	 public static void main(String[] args) {
	        
	    }
}
